import api from '@/api/index'
export default {
    state:{
        categoryObj:[]

    },
    mutations:{
        RECEIVE_GOODSLIST(state,payload){
            state.categoryObj = payload
          
        }


    },
    actions:{
       async getGoodsList({commit},params){
            const data =await api.reqGoodsList(params)

            
            if(data.status == 200){
                commit('RECEIVE_GOODSLIST',data)
            }
            
        }

    },
    getters:{
        goodsList(state){
            return state.categoryObj.goods || []
        },
        categoryAttribute(state){
            return state.categoryObj.categoryAttribute || []
        },
        goodsAttribute(state){
            return state.categoryObj.goodsAttribute || []
        },

    }
   
    
}